<br />
Rating of established players.<br /><br />

<?php 
$link = "index.php?date=" . strftime("%Y-%m-%d", $max_datesec);
if ($country_id > 0)
	$link .= "&country=$country_id";
?>

Last entry: <a class="link" href="<?php echo $link ?>">

<?php echo strftime("%Y-%m-%d", $max_datesec) ?></a><br />
<?php 
if (isset($country_name))
{
	echo "Country: $country_name";
	echo "<br />";
}

function get_params($p_country_id)
{
	global $country_id;
	global $date;
	$res = Array();
	if (!($country_id > 0))
		array_push($res, "country=$p_country_id");
	if ($date != "")
		array_push($res, "date=$date");
	if (count($res))
		return "?" . join("&amp;", $res);
	return "";
}

?>

<br />
<div class="centered">
<table class="bigtable">
<thead class="ui-widget-header">
	<tr>
		<th>Rank</th>
		<th>Player</th>
		<th>Rating</th>
		<th>G<sub>y1</sub></th>
		<th>G<sub>y2</sub></th>
		<th>G<sub>y5</sub></th>
		<th>Country</th>
	</tr>
</thead>
<tbody class="ui-widget-content">
<?php foreach ($plist as $p) {?>
	<?php if ($p->rank == 0) continue?>
	<tr class="<?php echo cycle('stripe1','stripe0') ?>">
	<td><?php echo $p->rank ?></td>
	<td><a class="link" href="player.php?id=<?php 
		echo $p->player_id ?>"><?php echo $p->surname ?>&nbsp;<?php echo $p->name?></a></td>
	<td><?php echo floor($p->player_end_rating) ?></td>
	<td><?php echo $p->g1 ?></td>
	<td><?php echo $p->g2 ?></td>
    <td><?php echo $p->g5 ?></td>
	
	<td><a class="smalllink2" href="index.php<?php echo get_params($p->country_id)?>"><?php echo $p->country_name ?></a></td>
	</tr>
<?php } //endfor ?>
</tbody>
</table>
</div>
